<template>
    <div>
        <!-- 表格表头 -->
        <div class="table-header">
            <div>
                <!-- <el-button-group>
                    <el-button icon="el-icon-circle-plus-outline" size="small"
                        @click="selectUserDailog(matedata.pkTable)">关联用户</el-button>
                    <el-button icon="el-icon-remove-outline" size="small" @click="deleteHandle()">删除用户</el-button>
                </el-button-group> -->
            </div>
            <div>
                <el-button size="small" round icon="el-icon-refresh" @click="getDataTable()"></el-button>
            </div>
        </div>

        <el-table :data="matedataList" size="small" min-height="300" style="width: 100%" highlight-current-row
            @selection-change="handleSelectionChange">
            <el-table-column type="selection" header-align="center" align="center" width="50">
            </el-table-column>
            <el-table-column prop="pkFild" header-align="center" align="center" show-overflow-tooltip label="字段主键">
            </el-table-column>
            <el-table-column prop="fildName" header-align="center" align="center" show-overflow-tooltip label="字段名称">
            </el-table-column>
            <el-table-column prop="fildType" header-align="center" align="center" show-overflow-tooltip label="字段类型">
            </el-table-column>
            <el-table-column prop="dataType" header-align="center" align="center" show-overflow-tooltip label="数据类型">
            </el-table-column>
            <el-table-column prop="isBlankDesc" header-align="center" align="center" show-overflow-tooltip label="是否空值">
            </el-table-column>
            <el-table-column prop="isPkDesc" header-align="center" align="center" show-overflow-tooltip label="是否主键">
            </el-table-column>
            <el-table-column prop="fildDesc" header-align="center" align="center" show-overflow-tooltip label="字段描述">
            </el-table-column>
            <div slot="empty">
                <div class="avue-empty">
                    <div class="avue-empty__image" style="height: 50px;"><img
                            src=""
                            alt=""></div>
                    <p class="avue-empty__desc">暂无数据</p>
                </div>
            </div>
        </el-table>

        <!--选择用户弹出框  -->
        <!-- <usergroup v-if="usergroupVisible" ref="usergroup" @refreshDataList="getUserRoleList"></usergroup> -->
    </div>

</template>
<script>
    import * as tabledataService from '@/api/bdms/tabledata'
    export default {
        data() {
            return {
                matedata: {
                    pkTable: ''
                },
                matedataList: [],
                usergroupVisible: false,
                multipleSelection: []
            }
        },
        components: {
            // Usergroup,
        },
        methods: {
            init(pkTable) {
                if (pkTable) {
                    this.matedata.pkTable = pkTable;
                    this.getDataTable()
                }
            },
            getDataTable() {
                this.loading = true
                let query = {
                    pkTable: this.matedata.pkTable
                };
                tabledataService.gettabledatalist(query).then(data => {
                    this.matedataList = data;
                    this.loading = false;
                }).catch((res) => {
                    this.loading = false;
                });
            },
            //多选
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
        }
    }
</script>